package com.leruan.aasimp.service.impl;

import java.util.List;
import java.util.Map;

import com.leruan.aasimp.dao.ReplyDao;
import com.leruan.aasimp.entity.Reply;
import com.leruan.aasimp.entitydto.ReplyDto;
import com.leruan.aasimp.service.ReplyService;

public class ReplyServiceImpl implements ReplyService {
    private ReplyDao replyDao;

    public void save(Reply reply) {
        replyDao.insertReply(reply);
    }

    public List<Reply> getReplyByPostId(String postId) {
        return replyDao.findReplyByPostId(postId);
    }

    public ReplyDao getReplyDao() {
        return replyDao;
    }

    public void setReplyDao(ReplyDao replyDao) {
        this.replyDao = replyDao;
    }

    public void removeReplyByPostId(String postId) {
        replyDao.deleteReplyByPostId(postId);
    }

    public List<ReplyDto> getReplyByPostId(String postId, Map<String, String> map, int pageNo) {
        return replyDao.findReplyByPostId(postId, map, pageNo);
    }

    public Long getReplyTotal(Map<String, String> map) {
        return replyDao.findReplyTotal(map);
    }

    public List<ReplyDto> getReply(Map<String, String> map, int pageNo) {
        return replyDao.findReply(map, pageNo);
    }

    public List<Reply> getReplyByUserId(String userId) {
        return replyDao.findReplyByUserId(userId);
    }

    public void modifyReply(Reply reply) {
        replyDao.updateReply(reply);
    }

    public Long getReplyNumberById(String userId) {
        return replyDao.findReplyNumberById(userId);
    }

    // public List<Reply> getReplyByPostId(String postId, int pageNo) {
    // return replyDao.findReplyByPostId(postId, pageNo);
    // }

}
